package com.zxy.ziems.server.statistics.controller;

import com.zxy.ziems.server.constant.DateType;
import com.zxy.ziems.server.dto.DataQueryDto;
import com.zxy.ziems.server.statistics.pojo.vo.HomologyChainVO;
import com.zxy.ziems.server.statistics.service.HomologyChainService;
import com.zxy.ziems.server.vo.ChartVo;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 同环比
 */
@RestController
@RequestMapping("/api/homologyChain")
public class HomologyChainController {

    @Autowired
    private HomologyChainService homologyChainService;

    /**
     * 年同环比列表
     *
     * @param dataQueryDto
     * @return
     */
    @GetMapping("/list")
    public HomologyChainVO list(DataQueryDto dataQueryDto, Integer homologyType) {
        return homologyChainService.list(dataQueryDto, homologyType);
    }


    /**
     * 年同环比列表导出
     *
     * @return
     */
    @GetMapping("/export")
    public void export(HttpServletResponse response, DataQueryDto dataQueryDto, Integer homologyType) {
        homologyChainService.export(response, dataQueryDto, homologyType);
    }

    /**
     * 周环比图
     *
     */
    @GetMapping("/dataChain")
    public HomologyChainVO dataChain(DataQueryDto dataQueryDto) {
        return homologyChainService.dataChain(dataQueryDto);
    }

    /**
     * 周总量对比
     *
     */
    @GetMapping("/totalDataChain")
    public HomologyChainVO totalDataChain(DataQueryDto dataQueryDto) {
        return homologyChainService.totalDataChain(dataQueryDto);
    }

}
